﻿using System;
using System.Collections.Generic;
using System.Text;

namespace DataObjectLayer
{
    public class PaperDOL
    {
        public const string Select = @"SELECT PAPERID, PAPERTITLE,IMAGEURL,FILEURL, DESCRIPTION FROM COMMON.PAPER";
        public const string Insert = @"INSERT INTO COMMON.PAPER(PAPERTITLE,DESCRIPTION,IMAGEURL,FILEURL) VALUES (@PaperTitle,@Description,@ImageURL,@FileURL)";
        public const string SelectComboBox = @"SELECT PAPERID, PAPERTITLE FROM COMMON.PAPER UNION (SELECT VALUE AS PAPERID, TEXT AS PAPERTITLE FROM COMMON.NOSELECTION)";
        public const string Delete = "DELETE FROM COMMON.PAPER WHERE PAPERID=@PaperId";
        public const string Update = "UPDATE COMMON.PAPER SET PAPERTITLE = @PaperTitle ,DESCRIPTION = @Description, IMAGEURL = @ImageURL, FILEURL = @FileURL WHERE PAPERID = @PaperId";
        public const string SelectMaxId = "SELECT ISNULL(MAX(PAPERID),0)+1 AS MAX_PAPER_ID FROM COMMON.PAPER";
        public enum QueryStatus { Select,SelectComboBox, Insert, Delete, Update, SelectMaxId };
    }
}
